/**
 * Created by zhaocong on 2016/8/2.
 * 可选服务
 */
define(['timepicker', 'tker-css'],function () {
  return new function () {

    var datetime = function () {
      $('.form_datetime').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        forceParse: 0,
        showMeridian: 1,
        startView: 1,
        minView: 0,
        format: "hh:ii"
      });
    };
    datetime();

    // 添加转机
    $('.con-wap').on('change','.J_newhx .J_zhuanji',function () {
      $(this).parents('.J_newhx').find('.J_hangx').toggleClass('hidden');
    });

    // 移除航线
    $('.con-wap').on('click','.J_delet',function () {
      $(this).parents('.J_newhx').remove();
    });

    // 添加航线
    $('#addnewhx').on('click',function () {
      $('.con-wap').append($('#hxModal .J_newhx:eq(0)').clone());
      datetime();
    });





  };
});